package com.chat.admin.domain.DTO.ADD;

import com.chat.admin.annotate.IsNumeric;
import com.chat.admin.annotate.ValidAccount;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import static com.chat.admin.common.constant.RegularExpression.ADMINPASSWORD;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class AddAdminDTO {
    /**
     * 账号
     */
    @IsNumeric(message = "账号只能是数字")
    @ValidAccount(min = 6, max = 11, message = "账号长度必须在6到11之间")
    private String account;
    /**
     * 用户名
     */
    @NotBlank(message = "用户名不能为空")
    @Size(min = 1, max = 20)
    private String username;
    /**
     * 密码
     */
    @NotBlank(message = "密码不能为空")
    @Size(min = 8, max = 18, message = "密码长度应在8到18位之间")
    @Pattern(regexp = ADMINPASSWORD, message = "密码格式应为8-18位数字、字母、符号的任意两种组合")
    private String password;
    /**
     * 角色
     */
    private Long roleId;
}
